﻿@using Model;
@{
    ViewBag.Title = "用户列表";
    ViewBag.MemCss = "active";
    List<Member> list = ViewBag.list;
}

<ul class="breadcrumb">
    <li>用户管理<span class="divider">/</span></li>
    <li class="active">@ViewBag.Title</li>
</ul>
<div class="container-fluid">
    <div class="row-fluid">

        <div class="row-fluid">

            <div class="btn-toolbar">
                <a class="btn" href="/Admin/Member/Add"><i class="fa fa-plus"></i> 新增</a>

            </div>
            <div class="well">
                <table class="table table-hover">
                    <thead>
                        <tr>
                            <th style="width:60px;">编号</th>
                            <th style="width:100px;">登陆名</th>
                            <th style="width:100px;">名称</th>
                            <th style="width:60px;">文章数量</th>
                            <th style="width:200px;">等级</th>
                            <th style="width:150px;">操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        @foreach (var item in list)
                        {
                            <tr>
                                <td>@item.mem_id</td>
                                <td>@item.mem_login</td>
                                <td>@item.mem_name</td>
                                <td>@item.mem_count</td>
                                <td>@item.mem_level</td>
                                <td>
                                    <a class="btn btn-info" href="/Admin/Member/Edit/@item.mem_id"><i class="fa fa-edit"></i> 编辑</a>
                                    <a class="btn btn-danger" onclick="del(@item.mem_id)"><i class="fa fa-trash-o"></i> 删除</a>
                                </td>
                            </tr>
                        }
                    </tbody>
                </table>
            </div>


        </div>



        @Html.Partial("_footer")

    </div>
</div>
<script>
    function del(id)
    {
        ConfirmDialog('确定要删除这条数据？', function () {
            AjaxGet('/Admin/Member/Delete', {'id':id}, function (mess) {
                AlertDialog(mess.msg, function () {
                    if(mess.code==200)
                    {
                        location.href = "/Admin/Member/List";
                    }
                });
            });
        });
    }
</script>

